package com.littleken.foodieCommon.Response;

/*
 * Create by littleken on 2020/11/16 10:52
 */
public enum ErrorCode implements IErrorCode {
    /**
     * 成功
     */
    SUCCESS(200, "SUCCESS"),
    /**
     * 服务器内部错误
     */
    INTERNAL_ERR(500, "服务器内部错误"),

    PARAMS_INVALID(100001, "参数不合法"),
    JSON_FORMAT_ERR(100002, "json数据格式不正确"),
    USER_IS_EXIST(100003,"用户已经存在"),
    SQL_EXECUTE_ERR(100004,"sql执行异常"),
    RECORD_NOT_EXIST(100005,"记录不存在"),
    PASSWORD_NOT_EQUALS(100006,"两次输入密码不相同"),
    PASSWORD_ERROR(100007,"用户名或密码错误"),
    ADDRESS_IS_DEFAULT(100008,"该地址已为默认地址"),
    ADDRESS_NOT_EXIST(100009,"地址不存在"),
    ERROR_PAYMETHOD(100010,"错误支付枚举"),
    ;

    private final Integer code;
    private final String dscr;

    ErrorCode(int code, String dscr) {
        this.code = code;
        this.dscr = dscr;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDscr() {
        return dscr;
    }
}

